package com.example.service.unity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {
    private Integer code;
    private String message;
    private T data;


    public static <T> Result<T> success(String message,T data){
        return new Result<>(ResultCode.SUCCESS,message,data);
    }
    public static <T> Result<T> error(int resultCode,String message){
        return  new Result<>(resultCode,message,null);
    }
}

